package cn.wolfcode.luowowo.article.service.impl;

import cn.wolfcode.luowowo.article.domain.DestIdDestTheme;
import cn.wolfcode.luowowo.article.mapper.DestIdDestThemeMapper;
import cn.wolfcode.luowowo.article.query.DestinationSearchQuery;
import cn.wolfcode.luowowo.article.service.IDestIdDestThemeService;
import com.alibaba.dubbo.config.annotation.Service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class DestIdDestThemeServiceImpl implements IDestIdDestThemeService {
    @Autowired
    private DestIdDestThemeMapper destThemeMapper;

    @Override
    public PageInfo query(DestinationSearchQuery qo) {
        PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
        return new PageInfo(destThemeMapper.selectForList(qo));
    }

    @Override
    public List<DestIdDestTheme> list() {
        return destThemeMapper.selectAll();
    }

}
